home *** CD-ROM | disk | FTP | other *** search
/ InterCD 2000 September / september_2000.iso / intercd / root / ^Linux / WindowMaker / src / application.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-10-21  |  2.1 KB  |  75 lines

  1. /*
  2.  *  Window Maker window manager
  3.  * 
  4.  *  Copyright (c) 1997, 1998 Alfredo K. Kojima
  5.  * 
  6.  *  This program is free software; you can redistribute it and/or modify
  7.  *  it under the terms of the GNU General Public License as published by
  8.  *  the Free Software Foundation; either version 2 of the License, or
  9.  *  (at your option) any later version.
  10.  *
  11.  *  This program is distributed in the hope that it will be useful,
  12.  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  13.  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14.  *  GNU General Public License for more details.
  15.  *
  16.  *  You should have received a copy of the GNU General Public License
  17.  *  along with this program; if not, write to the Free Software
  18.  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 
  19.  *  USA.
  20.  */
  21.  
  22.  
  23. #ifndef WMAPPLICATION_H_
  24. #define WMAPPLICATION_H_
  25.  
  26. /* for tracking single application instances */
  27. typedef struct WApplication {
  28.     struct WApplication *next;
  29.     struct WApplication *prev;
  30.     
  31.     Window main_window;               /* ID of the group leader */
  32.  
  33.     struct WWindow *main_window_desc;  /* main (leader) window descriptor */
  34.  
  35.     WMenu *menu;               /* application menu */
  36.  
  37.     struct WAppIcon *app_icon;
  38.  
  39.     int refcount;
  40.  
  41.     struct WWindow *last_focused;      /* focused window before hide */
  42.     
  43.     int last_workspace;               /* last workspace used to work on the 
  44.                     * app */
  45.     struct {
  46.     unsigned int skip_next_animation:1;
  47.     unsigned int hidden:1;
  48.     unsigned int emulated:1;
  49.     } flags;
  50. } WApplication;
  51.  
  52.  
  53. WApplication *wApplicationCreate(WScreen *scr, Window main_window);
  54. void wApplicationDestroy(WApplication *wapp);
  55.  
  56. WApplication *wApplicationOf(Window window);
  57.  
  58. void wApplicationExtractDirPackIcon(WScreen *scr,char *path, char *wm_instance, 
  59.                     char *wm_class);
  60.  
  61.  
  62. #ifdef NEWAPPICON
  63.  
  64. # define wApplicationActivate(wapp)    {\
  65.         wapp->main_window_desc->flags.focused=1; \
  66.         wAppIconPaint(wapp->app_icon);\
  67.     }
  68. #define wApplicationDeactivate(wapp)    {\
  69.         wapp->main_window_desc->flags.focused=0;\
  70.         wAppIconPaint(wapp->app_icon);\
  71.     }
  72. #endif
  73.  
  74. #endif
  75.